local Color = {}

function Color.newRgb(r, b, g)
    return CS.UnityEngine.Color(r / 255, b / 255, g / 255)
end

function Color.newRgba(r, b, g, a)
    return CS.UnityEngine.Color(r / 255, b / 255, g / 255, a / 255)
end

Color.PHYSICS_COLOR = Color.newRgb(255, 255, 255)
Color.FIRE_COLOR = Color.newRgb(255, 82, 0)
Color.THUNDER_COLOR = Color.newRgb(0, 255, 0)
Color.WATER_COLOR = Color.newRgb(32, 241, 255)
Color.TREATMENT_COLOR = Color.newRgb(184, 255, 32)

Color.RED_COLOR = Color.newRgb(255, 0, 0)
Color.BLACK_COLOR = Color.newRgb(255, 255, 255)
Color.GREEN_COLOR = Color.newRgb(104, 255, 0)

function Color.getElementColor(element)
    local AttributeConst = require("const.AttributeConst")
    if element == AttributeConst.ELEMENT_PHYSICS then
        return Color.PHYSICS_COLOR
    elseif element == AttributeConst.ELEMENT_FIRE then
        return Color.FIRE_COLOR
    elseif element == AttributeConst.ELEMENT_WATER then
        return Color.WATER_COLOR
    elseif element == AttributeConst.ELEMENT_THUNDER then
        return Color.THUNDER_COLOR
    elseif element == AttributeConst.ELEMENT_TREATMENT then
        return Color.TREATMENT_COLOR
    end
    return Color.PHYSICS_COLOR
end

return Color
